package aiku.numericalcontroloa.Model.Entity;

import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
import lombok.Data;

/**
 * 
 * @TableName die_bonusInfo
 */
@TableName(value = "die_bonusInfo")
@Data
public class DieBonusinfo implements Serializable {
    /**
     * 分红ID
     */
    @TableId(type = IdType.ASSIGN_UUID)
    private String bonusId;

    /**
     * 用户昵称
     */
    private String userId;

    /**
     * 分红金额
     */
    private BigDecimal price;

    /**
     * 时间
     */
    @TableField(value = "time", fill = FieldFill.INSERT)
    private Date time = new Date();

    /**
     * 分红类型
     */
    private String type;

    /**
     * 订单ID
     */
    private String customId;

    @TableField(exist = false)
    private static final long serialVersionUID = 1L;

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        DieBonusinfo other = (DieBonusinfo) that;
        return (this.getBonusId() == null ? other.getBonusId() == null : this.getBonusId().equals(other.getBonusId()))
                && (this.getUserId() == null ? other.getUserId() == null : this.getUserId().equals(other.getUserId()))
                && (this.getPrice() == null ? other.getPrice() == null : this.getPrice().equals(other.getPrice()))
                && (this.getTime() == null ? other.getTime() == null : this.getTime().equals(other.getTime()))
                && (this.getType() == null ? other.getType() == null : this.getType().equals(other.getType()))
                && (this.getCustomId() == null ? other.getCustomId() == null
                        : this.getCustomId().equals(other.getCustomId()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getBonusId() == null) ? 0 : getBonusId().hashCode());
        result = prime * result + ((getUserId() == null) ? 0 : getUserId().hashCode());
        result = prime * result + ((getPrice() == null) ? 0 : getPrice().hashCode());
        result = prime * result + ((getTime() == null) ? 0 : getTime().hashCode());
        result = prime * result + ((getType() == null) ? 0 : getType().hashCode());
        result = prime * result + ((getCustomId() == null) ? 0 : getCustomId().hashCode());
        return result;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", bonusId=").append(bonusId);
        sb.append(", userId=").append(userId);
        sb.append(", price=").append(price);
        sb.append(", time=").append(time);
        sb.append(", type=").append(type);
        sb.append(", customId=").append(customId);
        sb.append(", serialVersionUID=").append(serialVersionUID);
        sb.append("]");
        return sb.toString();
    }

    public Long getCreateTimeStamp() {
        return time.getTime();
    }
}